import React, { Component } from 'react';
import '../styles/Setup.scss'
import {Toast } from 'antd-mobile'
import { withRouter } from 'react-router-dom';
class Setup extends Component {
    constructor(props) {
        super(props)
        this.state = {
            centent_list:[
                {name:'头像'},
                {name:'修改手机号'},
                {name:'修改密码'},
                {name:'清除缓存'},
                {name:'检查更新'},
                {name:'推送设置'},
            ],
        }
    }
    fanClick(){
        this.props.history.go(-1)
    }
    loginClick(){
        Toast.show({
            content:'账号已退出请重新登录！',
            icon:'success'
        })
            this.props.history.push('/login')
    }
    render() {
        return (
            <div className='setup'>
                <div className="top">
                    <h3 onClick={() => { this.fanClick() }}>&lt; 设置</h3>
                </div>
                <div className="lists">
                        {
                            this.state.centent_list.map((item,index)=>{
                                return (
                                    <div className="list_info" key={index}>
                                        <div className="info_left">
                                            <p>{item.name}</p>
                                        </div>
                                        <div className="info-right">
                                            <p>&gt;</p>
                                        </div>
                                    </div>
                                )
                            })
                        }
                </div>
                <div className="btn">
                    <button onClick={()=>{this.loginClick()}}>退出登录</button>
                </div>
            </div>
        );
    }
}

export default withRouter(Setup);